<template>
  <div class="app-container">
    <panel types="primary">
      <template slot="title">查询条件</template>
      <template slot="body">
        <el-form :inline="true">

          <el-form-item label="姓名">
            <el-input v-model="formSearch.name" placeholder="支持模糊查询"></el-input>
          </el-form-item>

          <el-form-item>
            <el-button type="primary" v-on:click="search">查询</el-button>
          </el-form-item>
        </el-form>
      </template>
    </panel>

    <el-table :data="tableData" border>
      <el-table-column prop="id" label="编号"></el-table-column>
      <el-table-column prop="name" label="教师名称"></el-table-column>
      <el-table-column  label="头像">
        <template slot-scope="scope">
          <img v-bind:src="scope.row.portrait" width="150">
        </template>
      </el-table-column>
      <el-table-column prop="createTime" label="创建时间"></el-table-column>
    </el-table>

      <el-pagination
      v-on:size-change="handleSizeChange"
      v-on:current-change="handleCurrentChange"
      v-bind:page-sizes="[10, 20, 30, 40,50]"
      v-bind:current-page="formSearch.pageNumber"
      v-bind:page-size="formSearch.pageSize"
      v-bind:total="total"
      layout="total, sizes, prev, pager, next, jumper">
      </el-pagination>


  </div>
</template>

<script>
  import panel from '@/components/Panel/index.vue'
  import teacherService from '@/service/TeacherService.js'

  export default {
    name: 'Teacher',
    components: {
      panel
    },
    data() {
      return {
        tableData: [],
        total: 0,
        formSearch: {
          name: undefined,
          pageNumber: 1,
          pageSize: 10
        }
      }
    },
    methods: {

    },
    created() {
      teacherService.init(this)
    }
  }
</script>

<style>
</style>
